import QtQuick 1.1
import com.nokia.meego 1.0

Image {
    id: root
    property bool active: false
    property int count
    property string type

    property string mode: active || mouseArea.pressed ? "active" : "enable"

    signal clicked

    width: 100
    height: 40
    smooth: true

    source: "images/button_vote_%1.png".replace("%1",(mode))

    Row {
        anchors.centerIn: parent
        spacing: 10
        Image {
            source: "images/icon_%1_%2.png".replace("%1",(type)).replace("%2",(mode))
            smooth: true
        }
        Label {
            text: root.type == "comment" && count == 0 ? "评论" : count

            color: root.active ? "#D04F34" : appWindow.colorMid
        }
    }
    MouseArea {
        id: mouseArea
        anchors.fill: parent
        onClicked: root.clicked()
    }
}
